package com.example.springboottestgit.service;

import com.example.springboottestgit.bean.TenderBsn;
import com.example.springboottestgit.dao.TenderBsnMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.UUID;

/**
 * @description:
 * @author: ZZZ
 */
@Service
public class TenderBsnServer {
    @Autowired
    private TenderBsnMapper tenderBsnMapper;

    public String getBsn() {
        String bsn = String.valueOf(UUID.randomUUID()).replace("-", "");
        TenderBsn tenderBsn = new TenderBsn();
        tenderBsn.setBsn(bsn);
        tenderBsnMapper.insert(tenderBsn);
        return bsn;
    }
}
